package com.atguigu.gmall.realtime.flink.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class PhoenixUtil {

    public static  void executeSQL(String sql){
        // 1 连接  connection
        Connection connection=null;
        // 2 会话  statement
        PreparedStatement preparedStatement=null;
        //3  执行sql
        try {
            connection=DruidUtil.getPhoenixConn();
            preparedStatement= connection.prepareStatement(sql);
            preparedStatement.execute();
            connection.close();
        } catch (SQLException e) {
            throw new RuntimeException(e);

        }


    }
}
